﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Controls_LienHeTrucTuyen : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
            return;

        List<HoTroTrucTuyen> list = new HoTroTrucTuyenDAO().HienThiHoTroTrucTuyen();

        List<HoTroTrucTuyen> lst = new List<HoTroTrucTuyen>();

        for (int i = 0; i < list.Count; i++)
        {
            if (list[i].PhuongThuc == 0)
            {
                lbDienThoai.Text = list[i].NoiDung;
            }
            else
                lst.Add(list[i]);            
        }

        lbEmail1.Text = lst[0].TenHienThi.ToString();
        hplTuVan1.NavigateUrl = "ymsgr:sendim?" + lst[0].NoiDung;
        imgTuVan1.ImageUrl = "http://opi.yahoo.com/online?u=" + lst[0].NoiDung + "&m=g&t=1";

        lbEmail2.Text = lst[1].TenHienThi;
        hplTuVan2.NavigateUrl = "ymsgr:sendim?" + lst[1].NoiDung;
        imgTuVan2.ImageUrl = "http://opi.yahoo.com/online?u=" + lst[1].NoiDung + "&m=g&t=1";
    }
}